package sch.guo.crmsys.controller.auth;


import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.core.metadata.IPage;
import com.baomidou.mybatisplus.extension.plugins.pagination.Page;
import org.springframework.web.bind.annotation.*;
import org.springframework.web.bind.annotation.RestController;
import org.springframework.beans.factory.annotation.Autowired;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiImplicitParams;
import io.swagger.annotations.ApiOperation;
import sch.guo.crmsys.base.ResultUtil;
import sch.guo.crmsys.base.dto.ResultDTO;
import sch.guo.crmsys.service.auth.AuthPowerService;
import sch.guo.crmsys.entity.auth.AuthPower;

/**
 *
 * @author ${author}
 * @since 2022-07-10
 */
@RestController
@RequestMapping("/authPower")   //
public class AuthPowerController {

    @Autowired
    private AuthPowerService authPowerService;



    @GetMapping("/page")
    @ApiOperation("分页返回")
    public IPage<AuthPower> selectEntityPage(@RequestParam(value = "pageNum", defaultValue = "1") int pageNum,
                                            @RequestParam(value = "pageSize", defaultValue = "8") int pageSize)throws Exception{
        return authPowerService.page(new Page<AuthPower>(pageNum, pageSize));
    }

    @GetMapping("/list")
    @ApiOperation("不分页返回")
    public ResultDTO selectEntityPage()throws Exception{
        return ResultUtil.Success(authPowerService.list());//
    }


}